<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>Firmware for Arduino | PLEN Project Company Inc.: PLEN2::JointController Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Firmware for Arduino | PLEN Project Company Inc.
   </div>
  </td>
   <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('class_p_l_e_n2_1_1_joint_controller.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-attribs">Static Public Attributes</a> &#124;
<a href="class_p_l_e_n2_1_1_joint_controller-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">PLEN2::JointController Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Management class of joints.  
 <a href="class_p_l_e_n2_1_1_joint_controller.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_joint_controller_8h_source.html">JointController.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_l_e_n2_1_1_joint_controller_1_1_multiplexer.html">Multiplexer</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Management class (as namespace) of multiplexer.  <a href="class_p_l_e_n2_1_1_joint_controller_1_1_multiplexer.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:afc1766c764a64284d41c82021e362242"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#afc1766c764a64284d41c82021e362242">JOINT_INDEX</a> { <br />
&#160;&#160;<a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#afc1766c764a64284d41c82021e362242ab2f4826344e7638839699cc8148ad328">LEFT_SHOULDER_PITCH</a> = 0, 
<a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#afc1766c764a64284d41c82021e362242af008a689b2f89dffead884c736ff7c08">LEFT_THIGH_YAW</a> = 1, 
<a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#afc1766c764a64284d41c82021e362242a5057cb2ef842f16c0f30e620f08557a0">LEFT_SHOULDER_ROLL</a> = 2, 
<a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#afc1766c764a64284d41c82021e362242ab4e498d490532f3d092c8fa589951eef">LEFT_ELBOW_ROLL</a> = 3, 
<br />
&#160;&#160;<a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#afc1766c764a64284d41c82021e362242a5c4da976398690ab3cdc9d97f5685e2a">LEFT_THIGH_ROLL</a> = 4, 
<a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#afc1766c764a64284d41c82021e362242a2447668357fce2aea71b6ca26c10fa3e">LEFT_THIGH_PITCH</a> = 5, 
<a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#afc1766c764a64284d41c82021e362242a2824da020d7931cb905ec8d9c3ea77ad">LEFT_KNEE_PITCH</a> = 6, 
<a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#afc1766c764a64284d41c82021e362242ac297177b6c39d2ae68992d7ecbaaf82f">LEFT_FOOT_PITCH</a> = 7, 
<br />
&#160;&#160;<a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#afc1766c764a64284d41c82021e362242a5bb2d1aab38629cc8981fb6f9cfdf194">LEFT_FOOT_ROLL</a> = 8, 
<a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#afc1766c764a64284d41c82021e362242a3eee973aea74b552c3101a68a4eb0d3f">RIGHT_SHOULDER_PITCH</a> = 12, 
<a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#afc1766c764a64284d41c82021e362242a908e93415ede0846ef3e7720ade78640">RIGHT_THIGH_YAW</a> = 13, 
<a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#afc1766c764a64284d41c82021e362242a210c99378871f88b201086a58d26bda3">RIGHT_SHOULDER_ROLL</a> = 14, 
<br />
&#160;&#160;<a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#afc1766c764a64284d41c82021e362242adc12d320f64750f932282d0d4e514472">RIGHT_ELBOW_ROLL</a> = 15, 
<a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#afc1766c764a64284d41c82021e362242a404954ebd818241ad208e494382bb41e">RIGHT_THIGH_ROLL</a> = 16, 
<a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#afc1766c764a64284d41c82021e362242a0168d80e0cd2ca224a09e09f33e32ed7">RIGHT_THIGH_PITCH</a> = 17, 
<a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#afc1766c764a64284d41c82021e362242a21c1c217b111fff453b16207785998c3">RIGHT_KNEE_PITCH</a> = 18, 
<br />
&#160;&#160;<a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#afc1766c764a64284d41c82021e362242a3f031af8acd82fd1a696bf00396a5b3a">RIGHT_FOOT_PITCH</a> = 19, 
<a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#afc1766c764a64284d41c82021e362242a16879e981f1b31adc955ca0a195b223c">RIGHT_FOOT_ROLL</a> = 20
<br />
 }</td></tr>
<tr class="separator:afc1766c764a64284d41c82021e362242"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9c7a945eb7123c6eb994bd852d026658"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#a9c7a945eb7123c6eb994bd852d026658">BASIC_JOINT_SETTINGS</a> { <a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#a9c7a945eb7123c6eb994bd852d026658a8bd0c873ca3e8f227523356f9d09821d">JOINTS_SUM</a> = 24
 }</td></tr>
<tr class="separator:a9c7a945eb7123c6eb994bd852d026658"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a1c849e7c817d6120f93a6e064bb515a9"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#a1c849e7c817d6120f93a6e064bb515a9">JointController</a> ()</td></tr>
<tr class="memdesc:a1c849e7c817d6120f93a6e064bb515a9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor.  <a href="#a1c849e7c817d6120f93a6e064bb515a9">More...</a><br /></td></tr>
<tr class="separator:a1c849e7c817d6120f93a6e064bb515a9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5cfc9b85d14ee46878777655817c85d8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#a5cfc9b85d14ee46878777655817c85d8">loadSettings</a> ()</td></tr>
<tr class="memdesc:a5cfc9b85d14ee46878777655817c85d8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Load the joint settings.  <a href="#a5cfc9b85d14ee46878777655817c85d8">More...</a><br /></td></tr>
<tr class="separator:a5cfc9b85d14ee46878777655817c85d8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a59ddae85d7e65dd11466b6c033f7c244"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#a59ddae85d7e65dd11466b6c033f7c244">resetSettings</a> ()</td></tr>
<tr class="memdesc:a59ddae85d7e65dd11466b6c033f7c244"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reset the joint settings.  <a href="#a59ddae85d7e65dd11466b6c033f7c244">More...</a><br /></td></tr>
<tr class="separator:a59ddae85d7e65dd11466b6c033f7c244"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9accdda8b1417b5ec14bbaf363f30e80"><td class="memItemLeft" align="right" valign="top">const int16_t &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#a9accdda8b1417b5ec14bbaf363f30e80">getMinAngle</a> (uint8_t joint_id)</td></tr>
<tr class="memdesc:a9accdda8b1417b5ec14bbaf363f30e80"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get min angle of the joint given.  <a href="#a9accdda8b1417b5ec14bbaf363f30e80">More...</a><br /></td></tr>
<tr class="separator:a9accdda8b1417b5ec14bbaf363f30e80"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acdad667f3119369a0d253471f2dbdb47"><td class="memItemLeft" align="right" valign="top">const int16_t &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#acdad667f3119369a0d253471f2dbdb47">getMaxAngle</a> (uint8_t joint_id)</td></tr>
<tr class="memdesc:acdad667f3119369a0d253471f2dbdb47"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get max angle of the joint given.  <a href="#acdad667f3119369a0d253471f2dbdb47">More...</a><br /></td></tr>
<tr class="separator:acdad667f3119369a0d253471f2dbdb47"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af606d3baec771ef41fcca2bb281226de"><td class="memItemLeft" align="right" valign="top">const int16_t &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#af606d3baec771ef41fcca2bb281226de">getHomeAngle</a> (uint8_t joint_id)</td></tr>
<tr class="memdesc:af606d3baec771ef41fcca2bb281226de"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get home angle of the joint given.  <a href="#af606d3baec771ef41fcca2bb281226de">More...</a><br /></td></tr>
<tr class="separator:af606d3baec771ef41fcca2bb281226de"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6daf9f61199ebb265e2cf2e212826bbe"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#a6daf9f61199ebb265e2cf2e212826bbe">setMinAngle</a> (uint8_t joint_id, int16_t angle)</td></tr>
<tr class="memdesc:a6daf9f61199ebb265e2cf2e212826bbe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set min angle of the joint given.  <a href="#a6daf9f61199ebb265e2cf2e212826bbe">More...</a><br /></td></tr>
<tr class="separator:a6daf9f61199ebb265e2cf2e212826bbe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3abc9a19dd265cf3c2a801d5866b26f0"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#a3abc9a19dd265cf3c2a801d5866b26f0">setMaxAngle</a> (uint8_t joint_id, int16_t angle)</td></tr>
<tr class="memdesc:a3abc9a19dd265cf3c2a801d5866b26f0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set max angle of the joint given.  <a href="#a3abc9a19dd265cf3c2a801d5866b26f0">More...</a><br /></td></tr>
<tr class="separator:a3abc9a19dd265cf3c2a801d5866b26f0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abdb719ed8b5ceab459bdfca9cd6b92f7"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#abdb719ed8b5ceab459bdfca9cd6b92f7">setHomeAngle</a> (uint8_t joint_id, int16_t angle)</td></tr>
<tr class="memdesc:abdb719ed8b5ceab459bdfca9cd6b92f7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set home angle of the joint given.  <a href="#abdb719ed8b5ceab459bdfca9cd6b92f7">More...</a><br /></td></tr>
<tr class="separator:abdb719ed8b5ceab459bdfca9cd6b92f7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab39562b3b6262ce7a235e888bcbd2d1b"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#ab39562b3b6262ce7a235e888bcbd2d1b">setAngle</a> (uint8_t joint_id, int16_t angle)</td></tr>
<tr class="memdesc:ab39562b3b6262ce7a235e888bcbd2d1b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set angle of the joint given.  <a href="#ab39562b3b6262ce7a235e888bcbd2d1b">More...</a><br /></td></tr>
<tr class="separator:ab39562b3b6262ce7a235e888bcbd2d1b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8ead4e978493fae5c29c3f6646d10f94"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#a8ead4e978493fae5c29c3f6646d10f94">setAngleDiff</a> (uint8_t joint_id, int16_t angle_diff)</td></tr>
<tr class="memdesc:a8ead4e978493fae5c29c3f6646d10f94"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set angle to "angle-diff + home-angle" of the joint given.  <a href="#a8ead4e978493fae5c29c3f6646d10f94">More...</a><br /></td></tr>
<tr class="separator:a8ead4e978493fae5c29c3f6646d10f94"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2d54bcd56e1b5006be004e08a28e636b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#a2d54bcd56e1b5006be004e08a28e636b">dump</a> ()</td></tr>
<tr class="memdesc:a2d54bcd56e1b5006be004e08a28e636b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Dump the joint settings.  <a href="#a2d54bcd56e1b5006be004e08a28e636b">More...</a><br /></td></tr>
<tr class="separator:a2d54bcd56e1b5006be004e08a28e636b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-attribs"></a>
Static Public Attributes</h2></td></tr>
<tr class="memitem:a22ed12242639ae06856504511b708dca"><td class="memItemLeft" align="right" valign="top">static volatile bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#a22ed12242639ae06856504511b708dca">m_1cycle_finished</a></td></tr>
<tr class="memdesc:a22ed12242639ae06856504511b708dca"><td class="mdescLeft">&#160;</td><td class="mdescRight">Finished flag of PWM output procedure 1 cycle.  <a href="#a22ed12242639ae06856504511b708dca">More...</a><br /></td></tr>
<tr class="separator:a22ed12242639ae06856504511b708dca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aece295457b28793cf907d676efb4411d"><td class="memItemLeft" align="right" valign="top">static uint16_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#aece295457b28793cf907d676efb4411d">m_pwms</a> [<a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#a9c7a945eb7123c6eb994bd852d026658a8bd0c873ca3e8f227523356f9d09821d">JOINTS_SUM</a>]</td></tr>
<tr class="memdesc:aece295457b28793cf907d676efb4411d"><td class="mdescLeft">&#160;</td><td class="mdescRight">PWM buffer.  <a href="#aece295457b28793cf907d676efb4411d">More...</a><br /></td></tr>
<tr class="separator:aece295457b28793cf907d676efb4411d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Management class of joints. </p>
<p>In Atmega32u4, one timer can output 3 PWM signals at a time. The MCU can control 24 servos by connecting 3bit multiplexer in each signal output lines. </p>
</div><h2 class="groupheader">Member Enumeration Documentation</h2>
<a class="anchor" id="a9c7a945eb7123c6eb994bd852d026658"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#a9c7a945eb7123c6eb994bd852d026658">PLEN2::JointController::BASIC_JOINT_SETTINGS</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a class="anchor" id="a9c7a945eb7123c6eb994bd852d026658a8bd0c873ca3e8f227523356f9d09821d"></a>JOINTS_SUM&#160;</td><td class="fielddoc">
<p>Summation of the servos controllable. </p>
</td></tr>
</table>

</div>
</div>
<a class="anchor" id="afc1766c764a64284d41c82021e362242"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#afc1766c764a64284d41c82021e362242">PLEN2::JointController::JOINT_INDEX</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a class="anchor" id="afc1766c764a64284d41c82021e362242ab2f4826344e7638839699cc8148ad328"></a>LEFT_SHOULDER_PITCH&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="afc1766c764a64284d41c82021e362242af008a689b2f89dffead884c736ff7c08"></a>LEFT_THIGH_YAW&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="afc1766c764a64284d41c82021e362242a5057cb2ef842f16c0f30e620f08557a0"></a>LEFT_SHOULDER_ROLL&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="afc1766c764a64284d41c82021e362242ab4e498d490532f3d092c8fa589951eef"></a>LEFT_ELBOW_ROLL&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="afc1766c764a64284d41c82021e362242a5c4da976398690ab3cdc9d97f5685e2a"></a>LEFT_THIGH_ROLL&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="afc1766c764a64284d41c82021e362242a2447668357fce2aea71b6ca26c10fa3e"></a>LEFT_THIGH_PITCH&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="afc1766c764a64284d41c82021e362242a2824da020d7931cb905ec8d9c3ea77ad"></a>LEFT_KNEE_PITCH&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="afc1766c764a64284d41c82021e362242ac297177b6c39d2ae68992d7ecbaaf82f"></a>LEFT_FOOT_PITCH&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="afc1766c764a64284d41c82021e362242a5bb2d1aab38629cc8981fb6f9cfdf194"></a>LEFT_FOOT_ROLL&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="afc1766c764a64284d41c82021e362242a3eee973aea74b552c3101a68a4eb0d3f"></a>RIGHT_SHOULDER_PITCH&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="afc1766c764a64284d41c82021e362242a908e93415ede0846ef3e7720ade78640"></a>RIGHT_THIGH_YAW&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="afc1766c764a64284d41c82021e362242a210c99378871f88b201086a58d26bda3"></a>RIGHT_SHOULDER_ROLL&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="afc1766c764a64284d41c82021e362242adc12d320f64750f932282d0d4e514472"></a>RIGHT_ELBOW_ROLL&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="afc1766c764a64284d41c82021e362242a404954ebd818241ad208e494382bb41e"></a>RIGHT_THIGH_ROLL&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="afc1766c764a64284d41c82021e362242a0168d80e0cd2ca224a09e09f33e32ed7"></a>RIGHT_THIGH_PITCH&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="afc1766c764a64284d41c82021e362242a21c1c217b111fff453b16207785998c3"></a>RIGHT_KNEE_PITCH&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="afc1766c764a64284d41c82021e362242a3f031af8acd82fd1a696bf00396a5b3a"></a>RIGHT_FOOT_PITCH&#160;</td><td class="fielddoc">
</td></tr>
<tr><td class="fieldname"><a class="anchor" id="afc1766c764a64284d41c82021e362242a16879e981f1b31adc955ca0a195b223c"></a>RIGHT_FOOT_ROLL&#160;</td><td class="fielddoc">
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a1c849e7c817d6120f93a6e064bb515a9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">PLEN2::JointController::JointController </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Constructor. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a2d54bcd56e1b5006be004e08a28e636b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void PLEN2::JointController::dump </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Dump the joint settings. </p>
<p>Output result in JSON format as below. </p><div class="fragment"><div class="line">[</div>
<div class="line">    {</div>
<div class="line">        <span class="stringliteral">&quot;@device&quot;</span>: &lt;integer&gt;,</div>
<div class="line">        <span class="stringliteral">&quot;max&quot;</span>: &lt;integer&gt;,</div>
<div class="line">        <span class="stringliteral">&quot;min&quot;</span>: &lt;integer&gt;,</div>
<div class="line">        <span class="stringliteral">&quot;home&quot;</span>: &lt;integer&gt;</div>
<div class="line">    },</div>
<div class="line">    ...</div>
<div class="line">]</div>
</div><!-- fragment --> 
</div>
</div>
<a class="anchor" id="af606d3baec771ef41fcca2bb281226de"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const int16_t&amp; PLEN2::JointController::getHomeAngle </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>joint_id</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get home angle of the joint given. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">joint_id</td><td>Please set the joint id from which you want to get home angle.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Reference of home angle a joint expressed by <b>joint_id</b> has. </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">-32768</td><td>Argument error. (<b>joint_id</b> is invalid.) </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="acdad667f3119369a0d253471f2dbdb47"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const int16_t&amp; PLEN2::JointController::getMaxAngle </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>joint_id</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get max angle of the joint given. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">joint_id</td><td>Please set the joint id from which you want to get max angle.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Reference of max angle of a joint described by <b>joint_id</b>. </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">-32768</td><td>Argument error. (<b>joint_id</b> is invalid.) </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a9accdda8b1417b5ec14bbaf363f30e80"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const int16_t&amp; PLEN2::JointController::getMinAngle </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>joint_id</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get min angle of the joint given. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">joint_id</td><td>Please set the joint id from which you want to get min angle.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Reference of min angle of a joint described by <b>joint_id</b>. </dd></dl>
<dl class="retval"><dt>Return values</dt><dd>
  <table class="retval">
    <tr><td class="paramname">-32768</td><td>Argument error. (<b>joint_id</b> is invalid.) </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a5cfc9b85d14ee46878777655817c85d8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void PLEN2::JointController::loadSettings </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Load the joint settings. </p>
<p>The method reads joint settings from internal EEPROM. If the EEPROM has no settings, the method also writes the default values.</p>
<dl class="section see"><dt>See also</dt><dd>JointController.cpp::Shared::m_SETTINGS_INITIAL</dd></dl>
<dl class="section attention"><dt>Attention</dt><dd>The method should be called in constructor normally, but initialized timing of any interruption is indefinite, so it might get deadlocked. (The method uses serial communication and internal EEPROM access, so interruption happens.) </dd></dl>

</div>
</div>
<a class="anchor" id="a59ddae85d7e65dd11466b6c033f7c244"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void PLEN2::JointController::resetSettings </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reset the joint settings. </p>
<p>Write default settings to internal EEPROM. </p>

</div>
</div>
<a class="anchor" id="ab39562b3b6262ce7a235e888bcbd2d1b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool PLEN2::JointController::setAngle </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>joint_id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int16_t&#160;</td>
          <td class="paramname"><em>angle</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set angle of the joint given. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">joint_id</td><td>Please set the joint id from which you want to set the angle. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">angle</td><td>Please set angle that has steps of degree 1/10.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Result</dd></dl>
<dl class="section attention"><dt>Attention</dt><dd><b>angle</b> might not be set actually. It is set after trimming by user defined min-max value or servo's range, so please consider it when writing a unit test. </dd></dl>

</div>
</div>
<a class="anchor" id="a8ead4e978493fae5c29c3f6646d10f94"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool PLEN2::JointController::setAngleDiff </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>joint_id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int16_t&#160;</td>
          <td class="paramname"><em>angle_diff</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set angle to "angle-diff + home-angle" of the joint given. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">joint_id</td><td>Please set the joint id from which you want to set the angle-diff. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">angle_diff</td><td>Please set angle-diff that has steps of degree 1/10.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Result</dd></dl>
<dl class="section attention"><dt>Attention</dt><dd><b>angle_diff</b> might not be set actually. It is set after trimming by user defined min-max value or servo's range, so please consider it when writing a unit test. </dd></dl>

</div>
</div>
<a class="anchor" id="abdb719ed8b5ceab459bdfca9cd6b92f7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool PLEN2::JointController::setHomeAngle </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>joint_id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int16_t&#160;</td>
          <td class="paramname"><em>angle</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set home angle of the joint given. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">joint_id</td><td>Please set the joint id from which you want to define the home angle. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">angle</td><td>Please set angle that has steps of degree 1/10.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Result </dd></dl>

</div>
</div>
<a class="anchor" id="a3abc9a19dd265cf3c2a801d5866b26f0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool PLEN2::JointController::setMaxAngle </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>joint_id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int16_t&#160;</td>
          <td class="paramname"><em>angle</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set max angle of the joint given. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">joint_id</td><td>Please set the joint id from which you want to define the max angle. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">angle</td><td>Please set angle that has steps of degree 1/10.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Result </dd></dl>

</div>
</div>
<a class="anchor" id="a6daf9f61199ebb265e2cf2e212826bbe"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool PLEN2::JointController::setMinAngle </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>joint_id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int16_t&#160;</td>
          <td class="paramname"><em>angle</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set min angle of the joint given. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">joint_id</td><td>Please set the joint id from which you want to define the min angle. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">angle</td><td>Please set angle that has steps of degree 1/10.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Result </dd></dl>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a class="anchor" id="a22ed12242639ae06856504511b708dca"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">volatile bool PLEN2::JointController::m_1cycle_finished</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Finished flag of PWM output procedure 1 cycle. </p>
<dl class="section attention"><dt>Attention</dt><dd>The instance should be a private member normally. It is a public member because it is the only way to access it from Timer 1 overflow interruption vector, so you must not access it from other functions basically. </dd></dl>

</div>
</div>
<a class="anchor" id="aece295457b28793cf907d676efb4411d"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint16_t PLEN2::JointController::m_pwms[<a class="el" href="class_p_l_e_n2_1_1_joint_controller.html#a9c7a945eb7123c6eb994bd852d026658a8bd0c873ca3e8f227523356f9d09821d">JOINTS_SUM</a>]</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>PWM buffer. </p>
<dl class="section attention"><dt>Attention</dt><dd>The instance should be a private member normally. It is a public member because it is the only way to access it from Timer 1 overflow interruption vector, so you must not access it from other functions basically. </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="_joint_controller_8h_source.html">JointController.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespace_p_l_e_n2.html">PLEN2</a></li><li class="navelem"><a class="el" href="class_p_l_e_n2_1_1_joint_controller.html">JointController</a></li>
    <li class="footer">Generated on Tue Oct 11 2016 13:20:21 for Firmware for Arduino | PLEN Project Company Inc. by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.9.1 </li>
  </ul>
</div>
</body>
</html>
